﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WickedFlame.VecDraw.Base.Controls;

namespace WickedFlame.VecDraw.Dialog
{
    public enum ImageInsertDialogResult { 
		/// <summary>
		/// Resize canvas to fit pasted image
		/// </summary>
		Resize, 
		/// <summary>
		/// Keep canvas size
		/// </summary>
		Keep, 
		/// <summary>
		/// Do nothing
		/// </summary>
		None };
    /// <summary>
    /// Interaction logic for ImageCanvasSizeDialog.xaml
    /// </summary>
    public partial class ImageCanvasSizeDialog : VecDrawDialog
    {
        public ImageCanvasSizeDialog()
        {
            InitializeComponent();
        }

        BitmapImage _image;
        public BitmapImage Image
        {
            set
            {
                _image = value;
                imageDisplay.Source = _image;
            }
        }

        ImageInsertDialogResult dlgResult = ImageInsertDialogResult.None;
        public ImageInsertDialogResult ImageInsertDialogResult
        {
            get
            {
                return dlgResult;
            }
            set
            {
                dlgResult = value;
            }
        }

        private void btnResize_Click(object sender, RoutedEventArgs e)
        {
            dlgResult = ImageInsertDialogResult.Resize;
            this.DialogResult = true;
            this.Close();
        }

        private void btnStay_Click(object sender, RoutedEventArgs e)
        {
            dlgResult = ImageInsertDialogResult.Keep;
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancle_Click(object sender, RoutedEventArgs e)
        {
            dlgResult = ImageInsertDialogResult.None;
            this.DialogResult = false;
            this.Close();
        }
    }
}
